﻿<div class="container-fluid b-space">
    <div class="row" style="margin-top: 10px">
        <div class="col-xs-4">
            <div class="input-group input-group-sm">
                <span class="input-group-addon">身份证</span>
                <input type="text" class="form-control" ng-model="_case.current.condition.insurant_idcard" ng-blur="fn.search.clear_condition('insurant_idcard','current')"/>
            </div>
        </div>
        <div class="col-xs-4">
            <div class="input-group input-group-sm">
                <span class="input-group-addon">保单号</span>
                <input type="text" class="form-control" ng-model="_case.current.condition.policy_id" ng-blur="fn.search.clear_condition('policy_id','current')"/>
            </div>
        </div>
        <div class="col-xs-2">
            <div class="input-group input-group-sm">
                <span class="input-group-addon">姓名</span>
                <input type="text" class="form-control" ng-model="_case.current.condition.insurant_name" ng-blur="fn.search.clear_condition('insurant_name','current')"/>
            </div>
        </div>
        <div class="col-xs-2">
            <div class="btn-group btn-group-sm">
                <button type="button" class="btn btn-primary" ng-click="fn.search.from_server()">
                    搜索</button>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12" ng-if="user.authority_level <= 5">
            <div class="panel panel-default">
                <div class="panel-heading" style="padding: 7px 15px;">
                    <div class="input-group input-group-sm">
                        <button type="button" class="btn btn-primary btn-sm" ng-click="fn.create()" ng-if="user.authority_level == 1">
                            <i class="fa fa-plus"></i>
                            新增
                        </button>
                        <button type="button" class="btn btn-primary btn-sm" ng-click="fn.load_cases()" ng-if="user.authority_level > 1">
                            <i class="fa fa-plus"></i>
                            新增
                        </button>
                        <button type="button" class="btn btn-primary btn-sm" ng-show="_case.current.search.selected && _case.current.search.selected.is_submit == 0" ng-click="fn.modify()">
                            <i class="fa fa-pencil-square-o"></i>
                            修改
                        </button>
                    </div>
                </div>
                <!-- /.panel-heading -->
                <div class="panel-body">
                    <div class="dataTable_wrapper">
                        <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table width="100%" class="table table-striped table-bordered table-hover dataTable no-footer dtr-inline no-wrap" role="grid" aria-describedby="dataTables-example_info" style="width: 100%;">
                                        <thead>
                                        <tr role="row">
                                            <th rowspan="1" colspan="1"></th>
                                            <th rowspan="1" colspan="1">序号</th>
                                            <th rowspan="1" colspan="1">姓名</th>
                                            <th rowspan="1" colspan="1">居住地</th>
                                            <th rowspan="1" colspan="1">出险时间</th>
                                            <th rowspan="1" colspan="1">是否报案</th>
                                            <th rowspan="1" colspan="1">报案时间</th>
                                            <th rowspan="1" colspan="1">医院类型</th>
                                            <th rowspan="1" colspan="1">发票金额</th>
                                            <th rowspan="1" colspan="1">免赔额</th>
                                            <th rowspan="1" colspan="1">核减金额</th>
                                            <th rowspan="1" colspan="1">理赔类型</th>
                                            <th rowspan="1" colspan="1">理赔金额</th>
                                            <th rowspan="1" colspan="1" ng-if="user.authority_level != 5">是否提交</th>
                                            <th rowspan="1" colspan="1" ng-if="user.authority_level == 5">是否结案</th>
                                        </tr>
                                        </thead><!--ng-class="{even: $even, odd: $odd}"-->
                                        <tbody>
                                        <tr ng-repeat="_case in _case.current.search.filter" ng-click="fn.search.select(_case)"
                                            ng-class="{notice: _case.is_need_communication > 0 && _case.communication_result > 1,yellow: _case.is_diffcult > 0,important: _case.is_need_communication > 0 && _case.communication_result < 2}">
                                            <td>
                                                <input type="radio" name="check" ng-if="!_case.is_submit" class="form-control select" ng-checked="_case.checked" ng-model="_case.checked"/>
                                            </td>
                                            <td>
                                                {{$index + 1}}
                                            </td>
                                            <td>
                                                {{_case.insurant_name}}
                                            </td>
                                            <td>
                                                {{_case.insurant_habitation}}
                                            </td>
                                            <td>
                                                {{_case.accident_time}}
                                            </td>
                                            <td>
                                                {{_case.is_reported > 0 ? '是' : '否'}}
                                            </td>
                                            <td>
                                                {{_case.report_time}}
                                            </td>
                                            <td>
                                                {{_case.hospital_type}}
                                            </td>
                                            <td>
                                                {{_case.invoice_amount}}
                                            </td>
                                            <td>
                                                {{_case.deductible_amount}}
                                            </td>
                                            <td>
                                                {{_case.subtract_amount}}
                                            </td>
                                            <td>
                                                {{_case.compensation_type}}
                                            </td>
                                            <td>
                                                {{_case.compensation_amount}}
                                            </td>
                                            <td>
                                                {{_case.is_submit > 0 ? '是' : '否'}}
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-5">
                                    <div class="dataTables_length">
                                        <label>每页显示
                                            <select ng-change="page.current.turn_to(0)" ng-model="page.current.size" class="form-control input-sm" style="height: 25px;">
                                                <option value="15">15</option>
                                                <option value="25">25</option>
                                                <option value="50">50</option>
                                                <option value="100">100</option>
                                            </select>条，共{{page.current.all_items.last()}}页{{page.current.record_count}}条记录
                                        </label>
                                    </div>
                                </div>
                                <div class="col-sm-7">
                                    <div class="dataTables_paginate paging_simple_numbers">
                                        <ul class="pagination" style="margin: 0;">
                                            <li ng-click="page.current.turn_to(0)" ng-disabled="page.current.filtered.length == 1" class="paginate_button">
                                                <a href="javascript:void(0)">第一页</a>
                                            </li>
                                            <li ng-click="page.current.turn_to(page.current.index - 1)" ng-disabled="page.current.filtered.length == 1" class="paginate_button previous">
                                                <a href="javascript:void(0)">&laquo;</a>
                                            </li>
                                            <li ng-repeat="item in page.current.filtered track by $index" ng-click="page.current.turn_to(item - 1)" ng-class="{active: (page.current.index + 1) == item}" class="paginate_button">
                                                <a href="javascript:void(0)">{{item}}</a>
                                            </li>
                                            <li ng-click="page.current.turn_to(page.current.index + 1)" ng-disabled="page.current.filtered.length == 1" class="paginate_button next">
                                                <a href="javascript:void(0)">&raquo;</a>
                                            </li>
                                            <li ng-click="page.current.turn_to(page.current.all_items.length - 1)" ng-disabled="page.current.filtered.length == 1" class="paginate_button">
                                                <a href="javascript:void(0)">最后一页</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.table-responsive -->
                </div>
                <!-- /.panel-body -->
            </div>
            <!-- /.panel -->
        </div>
    </div>
</div>
<div ng-include="'templates/policy/select_case.html'"></div>